package com.yuyou.train.user.mapper;

import java.util.List;

import com.yuyou.train.user.vo.resp.RespUserMedalTop;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.yuyou.train.service.api.user.dto.UserMedalRelationDTO;
import com.yuyou.train.service.api.user.entity.UserMedalRelation;
import com.yuyou.train.util.bean.Pagination;

@Mapper
public interface UserMedalRelationMapper {
    int deleteByPrimaryKey(String id);

    int insert(UserMedalRelation record);

    UserMedalRelation selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(UserMedalRelation record);
    
    List<UserMedalRelationDTO> findUserItemRelaPageList(Pagination<UserMedalRelationDTO> p);
    
    int findUserItemRelaPageCount(Pagination<UserMedalRelationDTO> p);

    int countMedalByUserId(String userId);

    List<RespUserMedalTop> findUserMedalTop(String classId);

    Integer myRank(@Param(value = "classId") String classId, @Param(value = "userId") String userId);

    Integer countUserOfMedal(String classId);

    List<UserMedalRelation> findUserMedalRelationByUserId(String userId);
    
    UserMedalRelation selectUserMedalRelation(
    		@Param(value="userId") String userId,
    		@Param(value="medalItem") String medalItem);
}